import requests,unittest
from Day3.Tools import Tools
from ddt import data,unpack,ddt

path = r"C:\Users\HP\Desktop\table.xlsx"
sheetname = 'Sheet1'
dy = Tools(path, sheetname)
print(dy.getdata())

@ddt()
class A3mall(unittest.TestCase):
    token=None
    #登录 login
    @unpack
    @data(*dy.getdata())
    def test_01_login(self,username,password):
        login=requests.post(url='http://10.59.9.14:7003/api/public/login',
                                json={'username': username , 'password': password})
        print(login.json())
        # A3mall.token=login.json()['data']['token']
        # print(A3mall.token)




#执行
if __name__ == '__main__':
    unittest.main()
